/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mapdigit.practices.compositeui.smartparts;

import com.mapdigit.practices.compositeui.WorkItem;
import com.mapdigit.practices.compositeui.collections.ManagedObjectCollection;
import com.mapdigit.practices.compositeui.eventbroker.Event;
import com.mapdigit.practices.compositeui.eventbroker.EventHandler;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author jshen
 */
public abstract class Workspace<TSmartPart>  {

    @Event
    public EventHandler<WorkspaceCancelEventArgs> SmartPartClosing = null;
    /// <summary>
    /// Fires when the smartpart is activated.
    /// </summary>
    @Event
    public EventHandler<WorkspaceEventArgs> SmartPartActivated = null;
    /// <summary>
    /// A snapshot of the smart parts currently contained in the workspace.
    /// </summary>
    public ManagedObjectCollection<Object> SmartParts = null;
    /// <summary>
    /// The currently active smart part.
    /// </summary>
    public Object ActiveSmartPart = null;

    /// <summary>
    /// Activates the smartPart on the workspace.
    /// </summary>
    /// <param name="smartPart">The smart part to activate.</param>
    public abstract void Activate(Object smartPart);

    /// <summary>
    /// Closes a smart part. Disposing the smart part is the responsibility of the caller.
    /// </summary>
    /// <param name="smartPart">Smart part to close.</param>
    public abstract void Close(Object smartPart);

    /// <summary>
    /// Hides a smart part from the UI.
    /// </summary>
    /// <param name="smartPart">Smart part to hide.</param>
    public abstract void Hide(Object smartPart);

    /// <summary>
    /// Shows a smart part in the UI.
    /// </summary>
    /// <param name="smartPart">Smart part to show.</param>
    public abstract void Show(Object smartPart);
    
    private WorkItem workItem;
	
    private List<TSmartPart> smartParts = new ArrayList<TSmartPart>();
                
  
    
}
